<template>
	<view class="scrool-page">
		<!-- <view class="header-cont"></view> -->
		<view class="list-cont">
			<scroll-view  class="scrool-more" style="height: 100%" scroll-y="true" scroll-with-animation="true">
				<view v-for="(item,index) in productList" :key="item.id">
					<uni-card :title="'序号:'+(index+1)">
						<text class="uni-body">物料编码：{{ item.code }}</text><br>
						<text class="uni-body">数量：{{ item.number }}</text><br>
						<text class="uni-body">批次号：{{ item.patchNo }}</text><br>
					</uni-card>
				</view>				
			</scroll-view>			
		</view>
		
		<view class="footer">
			<button type="default"  @click="sumbit" >组托</button>
		</view>
	</view>
</template>

<script>
	import { getToken } from '@/utils/auth'
	export default {
		data() {
			return {
				id:'',
				productList:[
					// {id:'1',code:'001',number:'10',patchNo:'00001'},
					// {id:'2',code:'002',number:'20',patchNo:'00002'},
					// {id:'3',code:'003',number:'30',patchNo:'00003'},
					// {id:'4',code:'004',number:'40',patchNo:'00004'},
					// {id:'5',code:'005',number:'50',patchNo:'00005'},
					// {id:'6',code:'006',number:'10',patchNo:'00001'},
					// {id:'7',code:'007',number:'20',patchNo:'00002'},
					// {id:'8',code:'003',number:'30',patchNo:'00003'},
					// {id:'9',code:'004',number:'40',patchNo:'00004'},
				],
			}
		},
		
		onLoad: function (option) { //option为object类型，会序列化上个页面传递的参数
		    this.$forceUpdate();
			this.id = option.id;
		},
		
		created() {
			let token = getToken();
			uni.request({
				url:'',
				data:{
					id : this.id,
				},
				method: 'GET',
				header:{
					'authorization': token
				},
				dataType:'json',
				success: (res) =>{
					console.log(res);
				}
			})
		},
		
		methods: {
			sumbit(){
				
			},
		}
	}
</script>


 
 <style lang="less">
 page {
 	width: 100%;
 	height: 100%;
 }
 
 
 .scrool-page {
 	display: flex;
 	flex-direction: column;
 	width: 100%;
 	height: 100%;
 }
 
 .header-cont {
 	width: 100%;
 	height: 110rpx;
 	line-height: 100rpx;
 	text-align: center;
 	// background: red;
 }
 
 .list-cont {
 	flex: 1;
 	position: relative;
 
 	.scrool-more {
 		position: absolute;
 		left: 0;
 		right: 0;
 		top: 0;
 		bottom: 0;
 	}
 
 	.list {
 		height: 80rpx;
 		line-height: 80rpx;
 		text-align: center;
 		background: #e0e0e0;
 
 	}
 }
 
 
 .footer {
 	color: #fff;
 	line-height: 100rpx;
 	flex: 0 0 100rpx;
 	/* 不放大不缩小固定100rpx */
 }
 </style>